import win32api
import win32com.client
import string

def connect():
    dsn = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=m3Base1.hfd;Jet OLEDB:Database Password=reekciuq7034kyk;Jet OLEDB:System database=System.mdw;User ID=rsdyxjf43m3dbadm;Password=;'

    con = win32com.client.Dispatch('ADODB.Connection')
    con.Open(dsn)
    return con

if __name__ == '__main__':
    print("---------------")
    con = connect()
    f=open('1.txt', 'r')

try:    
            for line in f:   
                field = line.split(',')
		if field[0]=='date':	
			tt = field[1]             
                	print(tt)    						                
		else:
			value = "'"+field[2]+"',newDT='"+tt+"' where fSymbol='" + field[0]+"'"
                	sql = 'update 5mFund set Networth='+ value 
                	print(sql)    				
      	                con.Execute(sql)      		
                	
finally:
            f.close()